@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    --background: 0 0% 100%;
    --foreground: 20 14.3% 4.1%;

    --card: 0 0% 100%;
    --card-foreground: 20 14.3% 4.1%;

    --popover: 0 0% 100%;
    --popover-foreground: 20 14.3% 4.1%;

    --primary: 24 9.8% 10%;
    --primary-foreground: 60 9.1% 97.8%;

    --secondary: 60 4.8% 95.9%;
    --secondary-foreground: 24 9.8% 10%;

    --muted: 60 4.8% 95.9%;
    --muted-foreground: 25 5.3% 44.7%;

    --accent: 60 4.8% 95.9%;
    --accent-foreground: 24 9.8% 10%;

    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 60 9.1% 97.8%;

    --success: 147, 50%, 47%;
    --success-foreground: 60 9.1% 97.8%;

    --border: 20 5.9% 90%;
    --input: 20 5.9% 90%;
    --ring: 20 14.3% 4.1%;

    --radius: 0.5rem;
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;
    --card: 0 0% 100%;
    --card-foreground: 222.2 84% 4.9%;
    --popover: 0 0% 100%;
    --popover-foreground: 222.2 84% 4.9%;
    --primary: 222.2 47.4% 11.2%;
    --primary-foreground: 210 40% 98%;
    --secondary: 210 40% 96.1%;
    --secondary-foreground: 222.2 47.4% 11.2%;
    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;
    --accent: 210 40% 96.1%;
    --accent-foreground: 222.2 47.4% 11.2%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 210 40% 98%;
    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 222.2 84% 4.9%;
    /* --radius: 0.3rem; */
    --sidebar-background: 0 0% 100%;
    --sidebar-foreground: 222.2 84% 4.9%;
    --sidebar-primary: 222.2 47.4% 11.2%;
    --sidebar-primary-foreground: 0 0% 100%;
    --sidebar-accent: 210 40% 96.1%;
    --sidebar-accent-foreground: 222.2 47.4% 11.2%;
    --sidebar-border: 214.3 31.8% 91.4%;
    --sidebar-ring: 222.2 84% 4.9%;
  }

  .dark {
    --background: 0 0% 7.0588%;
    --foreground: 214.2857 31.8182% 91.3725%;
    --card: 0 0% 9.0196%;
    --card-foreground: 214.2857 31.8182% 91.3725%;
    --popover: 0 0% 14.1176%;
    --popover-foreground: 0 0% 66.2745%;
    --primary: 154.8980 100.0000% 19.2157%;
    --primary-foreground: 152.7273 19.2982% 88.8235%;
    --secondary: 0 0% 14.1176%;
    --secondary-foreground: 0 0% 98.0392%;
    --muted: 0 0% 12.1569%;
    --muted-foreground: 0 0% 63.5294%;
    --accent: 0 0% 19.2157%;
    --accent-foreground: 0 0% 98.0392%;
    --destructive: 6.6667 60.0000% 20.5882%;
    --destructive-foreground: 12.0000 12.1951% 91.9608%;
    --border: 0 0% 16.0784%;
    --input: 0 0% 14.1176%;
    --ring: 141.8919 69.1589% 58.0392%;
    --chart-1: 141.8919 69.1589% 58.0392%;
    --chart-2: 213.1169 93.9024% 67.8431%;
    --chart-3: 255.1351 91.7355% 76.2745%;
    --chart-4: 43.2558 96.4126% 56.2745%;
    --chart-5: 172.4551 66.0079% 50.3922%;
    --sidebar: 0 0% 7.0588%;
    --sidebar-foreground: 0 0% 53.7255%;
    --sidebar-primary: 154.8980 100.0000% 19.2157%;
    --sidebar-primary-foreground: 152.7273 19.2982% 88.8235%;
    --sidebar-accent: 0 0% 19.2157%;
    --sidebar-accent-foreground: 0 0% 98.0392%;
    --sidebar-border: 0 0% 16.0784%;
    --sidebar-ring: 141.8919 69.1589% 58.0392%;
    --font-sans: Outfit, sans-serif;
    --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
    --font-mono: monospace;
    /* --radius: 0.5rem; */
    --shadow-2xs: 0px 1px 3px 0px hsl(0 0% 0% / 0.09);
    --shadow-xs: 0px 1px 3px 0px hsl(0 0% 0% / 0.09);
    --shadow-sm: 0px 1px 3px 0px hsl(0 0% 0% / 0.17), 0px 1px 2px -1px hsl(0 0% 0% / 0.17);
    --shadow: 0px 1px 3px 0px hsl(0 0% 0% / 0.17), 0px 1px 2px -1px hsl(0 0% 0% / 0.17);
    --shadow-md: 0px 1px 3px 0px hsl(0 0% 0% / 0.17), 0px 2px 4px -1px hsl(0 0% 0% / 0.17);
    --shadow-lg: 0px 1px 3px 0px hsl(0 0% 0% / 0.17), 0px 4px 6px -1px hsl(0 0% 0% / 0.17);
    --shadow-xl: 0px 1px 3px 0px hsl(0 0% 0% / 0.17), 0px 8px 10px -1px hsl(0 0% 0% / 0.17);
    --shadow-2xl: 0px 1px 3px 0px hsl(0 0% 0% / 0.43);
    --sidebar-background: 0 0% 7.0588%;
    --sidebar-foreground: 214.2857 31.8182% 91.3725%;
    --sidebar-primary: 154.8980 100.0000% 19.2157%;
    --sidebar-primary-foreground: 152.7273 19.2982% 88.8235%;
    --sidebar-accent: 0 0% 19.2157%;
    --sidebar-accent-foreground: 0 0% 98.0392%;
    --sidebar-border: 0 0% 16.0784%;
    --sidebar-ring: 141.8919 69.1589% 58.0392%;
  }
}

@layer base {
  * {
    @apply border-border;
  }

  body {
    @apply bg-background text-foreground;
  }
}


/* Custom scrollbars for all elements except Radix ScrollArea */
:not(.os-scrollbar)::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

:not(.os-scrollbar)::-webkit-scrollbar-thumb {
  background-color: transparent;
  border-radius: 9999px;
  transition: background-color 0.3s ease;
}

.dark :not(.os-scrollbar)::-webkit-scrollbar-thumb {
  background-color: transparent;
}

:not(.os-scrollbar).scrollbar-active::-webkit-scrollbar-thumb {
  background-color: hsl(240 5% 64.9%);
}

.dark :not(.os-scrollbar).scrollbar-active::-webkit-scrollbar-thumb {
  background-color: hsl(240 5% 34.9%);
}

/* Special handling for Radix ScrollArea */
[data-radix-scroll-area-viewport] {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

[data-radix-scroll-area-viewport]::-webkit-scrollbar {
  display: none;
}

/* Firefox support */
:root {
  scrollbar-color: hsl(240 5% 64.9%) transparent;
  scrollbar-width: thin;
}

.dark {
  scrollbar-color: hsl(240 5% 34.9%) transparent;
}

/* Firefox support */
html {
  /* scrollbar-color: transparent transparent; */
  scrollbar-width: thin;
}

.scrollbar-active {
  scrollbar-color: rgba(113, 113, 122, 0.4);
}

@media (prefers-color-scheme: dark) {
  .scrollbar-active {
    scrollbar-color: rgba(82, 82, 91, 0.6) transparent;
  }
}

/* Custom scrollbar for Radix ScrollArea in sidebar */
[data-radix-scroll-area-viewport] {
  scrollbar-width: thin !important;
  -ms-overflow-style: auto !important;
}

[data-radix-scroll-area-viewport]::-webkit-scrollbar {
  display: block !important;
  width: 4px;
  height: 4px;
}

[data-radix-scroll-area-viewport]::-webkit-scrollbar-thumb {
  background-color: hsl(215.4 16.3% 46.9%);
  border-radius: 9999px;
}

[data-radix-scroll-area-viewport]::-webkit-scrollbar-track {
  background: transparent;
}

/* Dark mode */
.dark [data-radix-scroll-area-viewport]::-webkit-scrollbar-thumb {
  background-color: hsl(215.4 16.3% 56.9%);
}

.bg-success {
  background-color: hsl(var(--success));
}

body {
  overflow: hidden;
}

.empty-table {
  height: calc(100vh - 90px);
}

@keyframes bgColorChange {
  0% {
    background-color: hsl(var(--muted-foreground)/0.2);
  }

  100% {
    background-color: transparent;
  }
}

.table-row-bg {
  animation: bgColorChange 2s ease-in-out;
}

.overview {
  max-height: calc(100vh - 115px);
}

/* Fix for Resizable.Panel */
.resizable-panel>div {
  display: flex !important;
  min-width: 0;
  min-height: 0;
}

/* Monaco editor container fix */
.monaco-editor {
  overflow: hidden;
}

/* Parent container fix */
[data-radix-scroll-area-viewport] {
  min-width: 0 !important;
}

@keyframes spin-clockwise {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.group:hover .border-animate {
  animation: spin-clockwise 2s linear infinite;
}

@keyframes spinGlow {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* @keyframes rotateBorder {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.rotating-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(from 0deg, cyan, purple, yellow, cyan);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: rotateBorder 2s linear infinite;
  z-index: 0;
} */


/* 
@keyframes pulseBorder {
  0%, 100% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

.pulsating-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(90deg, cyan, purple, yellow);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: pulseBorder 2s ease-in-out infinite;
  z-index: 0;
} */

/* Pause animation on hover */
/* .pulsating-border:hover::before {
  animation-play-state: paused;
}
 */




@keyframes pulseBorder {

  0%,
  100% {
    opacity: 0.4;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

@keyframes pulseBackground {

  0%,
  100% {
    background: radial-gradient(circle, rgba(0, 255, 255, 0.1) 0%, rgba(0, 255, 255, 0.05) 50%, transparent 100%);
  }

  33% {
    background: radial-gradient(circle, rgba(128, 0, 128, 0.1) 0%, rgba(128, 0, 128, 0.05) 50%, transparent 100%);
  }

  66% {
    background: radial-gradient(circle, rgba(255, 255, 0, 0.1) 0%, rgba(255, 255, 0, 0.05) 50%, transparent 100%);
  }
}

.pulsating-border {
  position: relative;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.pulsating-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(90deg, rgb(0, 255, 21), purple, yellow);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: pulseBorder 2s ease-in-out infinite;
  z-index: 0;
}

/* Animated background blur with matching colors */
.pulsating-border::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  animation: pulseBackground 2s ease-in-out infinite;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: -1;
}

/* Pause animations on hover */
.pulsating-border:hover::before {
  animation-play-state: paused;
}

.pulsating-border:hover::after {
  animation-play-state: paused;
}


/* @keyframes pulseBorder {
      0%, 100% {
        opacity: 0.4;
        transform: scale(1);
      }
      50% {
        opacity: 1;
        transform: scale(1.05);
      }
    }

    .pulsating-border::before {
      content: '';
      position: absolute;
      inset: 0;
      border-radius: inherit;
      padding: 2px;
      background: linear-gradient(90deg, cyan, purple, yellow);
      -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
      -webkit-mask-composite: xor;
      mask-composite: exclude;
      animation: pulseBorder 2s ease-in-out infinite;
      z-index: 0;
    } */

/* In your global CSS file, e.g., index.css or App.css */

.mouse-cursor-gradient-tracking {
  position: relative;
  /* Remove the background gradient here as it's now applied to the outer div on hover */
  /* background: radial-gradient(circle closest-side, pink, transparent); */
  padding: 1rem 2rem;
  /* Button padding - adjust as needed */
  border-radius: 0.5rem;
  /* Button border radius */
  overflow: hidden;
  /* Hide overflow to make the border effect appear within the button's bounds */
  transition: all 0.3s ease;
  /* Smooth transition for various properties */
}

/* This is where the magic happens for the dynamic border gradient */
.mouse-cursor-gradient-tracking::before {
  content: '';
  position: absolute;
  top: var(--y);
  /* Dynamically set by JavaScript */
  left: var(--x);
  /* Dynamically set by JavaScript */
  width: var(--size);
  /* Dynamically set by JavaScript */
  height: var(--size);
  /* Dynamically set by JavaScript */
  transform: translate(-50%, -50%);
  /* Center the pseudo-element */
  background: radial-gradient(circle closest-side,
      hsl(var(--hue),
        80%,
        80%),
      /* Dynamic hue for colorful effect */
      transparent);
  /* Radial gradient for the border */
  opacity: 0;
  /* Initially hidden */
  transition: opacity 0.3s ease, background 0.3s ease;
  /* Smooth fade-in/out */
  pointer-events: none;
  /* Crucial for mouse events to pass through to the button */
  z-index: 0;
  /* Ensure this is behind the inner content */
}

.mouse-cursor-gradient-tracking:hover::before {
  opacity: 1;
  /* Show the gradient border on hover */
}

/* The inner button content */
.mouse-cursor-gradient-tracking>button {
  /* Ensure the inner button is above the pseudo-element */
  z-index: 1;
  /* Example: If outer container is rounded-lg (8px), and p-px (1px padding/border),
     inner button would be rounded-[calc(0.5rem-1px)] or rounded-[7px] */
  border-radius: calc(0.5rem - 1px);
  /* Match inner radius to visually create the border */
}

.mouse-cursor-gradient-tracking>button svg {
  position: relative;
  z-index: 1;
  /* Ensure Lucide icon is above the gradient border */
  /* Ensure icon color matches your button's content color */
}

/* @keyframes spin-clockwise {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes spin-counter-clockwise {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(-360deg);
  }
}

.spin-clockwise:hover .gradient-border {
  animation: spin-clockwise 2s linear infinite;
}

.spin-counter-clockwise:hover .gradient-border {
  animation: spin-counter-clockwise 2s linear infinite;
} */